<script lang="ts" setup>
import useTrail from '@/composables/custcare/talk/useTrail';
import Record from './Record.vue';

const props = defineProps(['visitorInfo'])

const { mainLayoutHeight, trailList, recordRef, showRecordBtn } = useTrail(props.visitorInfo)
</script>
<template>
    <div class="trail" :style="{ height: mainLayoutHeight + 'px' }">
        <div class="trail-main" v-for="item in trailList.data">
            <div class="created_at">{{ item.created_at }}</div>
            <div class="content">
                <div class="user">{{ item.nickname }}</div>
                <div class="status" v-if="visitorInfo.channel_id != item.channel_id">
                    <el-button size="small" type="primary" @click="showRecordBtn(item)">消息记录</el-button>
                </div>
            </div>
        </div>
    </div>
    <Record ref="recordRef"></Record>
</template>